/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.config.service.login;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.config.entity.login.ConfigLoginQQ;
import com.thinkgem.jeesite.modules.config.dao.login.ConfigLoginQQDao;

/**
 * QQ登录配置Service
 * @author JiangYongKang
 * @version 2016-12-14
 */
@Service
@Transactional(readOnly = true)
public class ConfigLoginQQService extends CrudService<ConfigLoginQQDao, ConfigLoginQQ> {
    
    @Autowired
    private ConfigLoginQQDao configLoginQQDao;

	public ConfigLoginQQ get(String id) {
		return super.get(id);
	}
	
	public ConfigLoginQQ getConfigQQ(){
	    List<ConfigLoginQQ> list = configLoginQQDao.findList(new ConfigLoginQQ());
	    if(!list.isEmpty()){
	        return list.get(0);
	    }
	    return null;
	}
	
	public List<ConfigLoginQQ> findList(ConfigLoginQQ configLoginQQ) {
		return super.findList(configLoginQQ);
	}
	
	public Page<ConfigLoginQQ> findPage(Page<ConfigLoginQQ> page, ConfigLoginQQ configLoginQQ) {
		return super.findPage(page, configLoginQQ);
	}
	
	@Transactional(readOnly = false)
	public void save(ConfigLoginQQ configLoginQQ) {
		super.save(configLoginQQ);
	}
	
	@Transactional(readOnly = false)
	public void delete(ConfigLoginQQ configLoginQQ) {
		super.delete(configLoginQQ);
	}
	
}